import { request } from '@/utils/request';
import { stringify } from 'qs';

// 優惠券列表
export async function queryBraCouponList(data: any): Promise<responseData> {
  return request(`/plat/public/service/coupon/list?${stringify(data)}`,)
}

//領取優惠券
export async function queryGetCoupon(couponId:string, data:any): Promise<responseData> {
  return request(`/plat/public/service/mycoupon/receive/${couponId}`, {
    method: 'POST',
    data
  })
}

// 獲取我的優惠券列表
export const queryMineCouponList: any = (data: any) => {
  return request(` /plat/public/service/mycoupon/list/umepass?${stringify(data)}`)
};


// 使用優惠券
export const queryUseCoupon: any = (data: any) => {
  return request(` /scan/qrcode/meal/order/choose/coupon`, {
    method: 'POST',
    data
  })
};

// 取消當前優惠券
export const queryCancleCoupon: any = (data: any) => {
  return request(`/scan/qrcode/meal/order/release/coupon`, {
    method: 'POST',
    data
  })
};